﻿// <copyright file="EasyWebApp.cs" company="<Customer Name>">This is a "work-for-hire".</copyright><author><Class Author's Name></author>

/*
 *      Title:    <Class Description>
 *      Module:   ClassTemplate (<Namespace>:ClassTemplate.cs)
 *      Project:  <Project Name>
 *      Customer: <Customer Name>
 *      Facility: MicroCODE Incorporated
 *      Date:     <Class Creation Date>
 *      Author:   <Class Author's Name>
 * 
 * 
 * 
 *  
 *      MODIFICATIONS:
 *      --------------
 *
 *  Date:         By-Group:   Rev:     Description:
 *
 *  DD-Mmm-YYYY   XYZ-GROUP  {0001}    Describe reason for creating or modifying class... 
 * 
 * 
 * 
 */
using System;
using System.Collections.Generic;
using System.Text;
using Org.EasyWeb.DataAccess;
using Org.EasyWeb.Data;
using System.Web;
using System.Data;
using Org.EasyWeb.ConfigXml;

namespace Org.EasyWeb.Right.Data
{
    [Resolver(AutoTableResolver.REG_NAME, Description = "Retrieve the data from specific table name.",
        Author = "Amen", CreateDate = "2012-02-07")]
    public class AutoTableResolver : Xml2TableResolver
    {
        internal const string REG_NAME = "AutoTable";
                
        public AutoTableResolver(DataSet hostDataSet)
            : base(hostDataSet)
		{
            string tableName = GlobalVariable.Request.QueryString["Table"];

            AutoGenerateXmlTable xmlStr = (AutoGenerateXmlTable)GlobalVariable.AppGbl.Caches[AppCachesHashTable.AUTO_TABLE_NAME].GetItem(tableName);

            AutoTableXmlFile autoXml = new AutoTableXmlFile(xmlStr.Key);
            
            SetDataXml(autoXml);

            AutoUpdating = false;
		}
    }
}
